﻿namespace IOP.Pulsar.Abstractions
{
    /// <summary>
    /// 上下文池
    /// </summary>
    public interface IContextPool<TContext>
        where TContext : class, new()
    {
        /// <summary>
        /// 从上下文队列中拉取上下文
        /// </summary>
        /// <returns></returns>
        TContext GetContext();
        /// <summary>
        /// 回收上下文
        /// </summary>
        /// <param name="context"></param>
        void Recovery(TContext context);
    }
}
